package se.webbzon.oschi01.json;

import java.io.IOException;
import java.io.PrintStream;
import java.io.Serializable;

public interface JsonType extends Cloneable, Serializable {
	
	/** The JSON's basic types. **/
	public enum Type {Number, String, Boolean, Array, Object, Null};
	
	/** Returns the JSON basic type of this JSON type. **/
	public Type getType();
	
	/** Converts this object to a JSON representation and writes it
	 * to the provided PrintStream. **/
	public void printTo(PrintStream ps) throws IOException;
	
	/** Converts this object to a JSON representation. **/
	@Override public String toString();
	
	/** Returns the hash code of this JSON type. **/
	@Override public int hashCode();
	
	public JsonType clone();

}
